﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using Blazing.BusinessObjects.Tagging;
using Blazing.WebFacade;
using Iesi.Collections.Generic;
using Blazing.UI.Cms.Admin.Classes;

namespace Blazing.UI.Cms.Admin
{
    public partial class ManageTags : SiteBasePage
	{
		protected void Page_Load(object sender, EventArgs e)
		{
            if (!IsPostBack)
            {
                PanelAddTaxonomy.Attributes.Add("style", "display: none");
            }

		}

        protected void btnAddTags_Click(object sender, EventArgs e)
        {
            Taxonomy taxonomy = SelectTags1.SelectedTaxonomy;
            TaxonomyTag parent = SelectTags1.SelectedParentTag;
            List<string> tagList = SelectTags1.Tags;
            TaggingController controller = new TaggingController();
            List<TaxonomyTag> addTags = new List<TaxonomyTag>();

            controller.ProcessTagList(taxonomy.ID, parent, tagList, true);
            SelectTags1.Clear();

            GridViewTaxonomyTags.DataBind();

        }

        protected void ButtonFilter_Click(object sender, EventArgs e)
        {
            GridView1.DataBind();
        }

        protected void odsTaxonomies_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            UpdatePanelTaxonomyTags.Update();
        }
	}
}
